package cn.dgiot.fd.service;

import com.aliyuncs.iot.model.v20180120.CreateOTAFirmwareResponse;
import com.aliyuncs.iot.model.v20180120.CreateOTAModuleResponse;
import com.aliyuncs.iot.model.v20180120.CreateOTAStaticUpgradeJobResponse;
import com.aliyuncs.iot.model.v20180120.CreateOTAVerifyJobResponse;
import com.aliyuncs.iot.model.v20180120.DeleteOTAFirmwareResponse;
import com.aliyuncs.iot.model.v20180120.DeleteOTAModuleResponse;
import com.aliyuncs.iot.model.v20180120.GenerateOTAUploadURLResponse;
import com.aliyuncs.iot.model.v20180120.ListOTAModuleByProductResponse;
import com.aliyuncs.iot.model.v20180120.UpdateOTAModuleResponse;

import cn.dgiot.fd.model.OTAModel;

public interface IOTAService {
	
	/**
	 * [创建升级包]
	 * @param otaModel
	 */
	CreateOTAFirmwareResponse createOTAFirmware(OTAModel otaModel);

	/**
	 * [生成oss上传地址、秘钥]
	 * @return
	 */
	GenerateOTAUploadURLResponse generateOTAUploadURL();
	
	/**
	 * [文件上传到oss服务]
	 * @param generateOTAUploadURLResponse
	 * @return
	 */
	boolean uploadFileToBucket(OTAModel otaModel,GenerateOTAUploadURLResponse generateOTAUploadURLResponse);
	
	/**
	 * [创建固件验证任务]
	 * @return
	 */
	CreateOTAVerifyJobResponse createOTAVerifyJob(OTAModel otaModel);
	
	/**
	 * [创建静态升级任务]
	 * @param otaModel
	 * @return
	 */
	CreateOTAStaticUpgradeJobResponse createOTAStaticUpgradeJob(OTAModel otaModel);
	
	/**
	 * [删除升级包]
	 * @param otaModel
	 * @return
	 */
	DeleteOTAFirmwareResponse deleteOTAFirmware(OTAModel otaModel);
	
	/**
	 * [创建升级模块]
	 * @param otaModel
	 * @return
	 */
	CreateOTAModuleResponse createOTAModule(OTAModel otaModel);
	
	/**
	 * [修改升级模块]
	 * @param otaModel
	 * @return
	 */
	UpdateOTAModuleResponse updateOTAModule(OTAModel otaModel);
	
	/**
	 * [删除升级模块]
	 * @param otaModel
	 * @return
	 */
	DeleteOTAModuleResponse deleteOTAModule(OTAModel otaModel);
	
	/**
	 * [查询升级模块]
	 * @param otaModel
	 * @return
	 */
	ListOTAModuleByProductResponse listOTAModuleByProduct(OTAModel otaModel);
}
